package chapter8.quarter4;

import javax.swing.*;
import java.awt.*;

public class BorderLayoutDemo {
    private JFrame frame;
    private JButton be,bw,bn,bs,bc;

    public static void main(String[] args) {
        BorderLayoutDemo that=new BorderLayoutDemo();
        that.go();
    }

    public void go() {
        frame=new JFrame("Border layout");
        be=new JButton("east");
        bw=new JButton("west");
        bn=new JButton("north");
        bs=new JButton("south");
        bc=new JButton("center");
        frame.getContentPane().add(be, BorderLayout.EAST);
        frame.getContentPane().add(bw, BorderLayout.WEST);
        frame.getContentPane().add(bn, BorderLayout.NORTH);
        frame.getContentPane().add(bs, BorderLayout.SOUTH);
        frame.getContentPane().add(bc, BorderLayout.CENTER);
        frame.setSize(350,200);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
